package com.gxa.javaserver.controller;

import com.gxa.javaserver.dao.AdminMapper;
import com.gxa.javaserver.pojo.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@RestController
public class IndexController {

    /**
     * 测试方法
     * @return
     */
    @GetMapping("/index")
    public String index(){
        return "Hello 四川大学!";
    }


    /**
     * 测试@RequestMapping
     * @return
     */
    @RequestMapping(path = "/index2",method = RequestMethod.GET)
    public String index2(){
        return "Hello World!";
    }


    /**
     * 测试post请求
     * @return
     */
    @PostMapping("/index3")
    public String index3(@RequestParam(name = "myId",defaultValue = "9") Integer id){

        return "Hello Post!-"+id;
    }


    /**
     * 测试路径传参
     * @return
     */
    @PostMapping("/index4/{id}")
    public String index4(@PathVariable("id") Integer id){

        return "Hello Path:"+id;
    }





}
